import api from "../model/api";
import axios from "../model/axios";

export  const  movieBannerQuery  = ()=>{
    return  axios({
        method:"get",
        url:api.movie.banner,
    })
}

export  const  hotMovieQuery = ()=>{
    return  axios({
        method:"get",
        url:api.movie.hotMovie,
    })
}

export  const  hotMoviedetail = (id:any)=>{
    return  axios({
        method:"get",
        url:api.movie.hotMoviedetail+id,
    })
}

export  const  filmPreviewQuery = ()=>{
    return  axios({
        method:"get",
        url:api.movie.filmPreview,
    })
}

// 查询电影院
export  const  theatreQuery = ()=>{
    return  axios({
        method:"get",
        url:api.movie.theatre,
    })
}
// 电影院详情
export  const  theatredetail = (id:any)=>{
    return  axios({
        method:"get",
        url:api.movie.theatredetail+id,
    })
}

export  const  commentAdd = (data:any)=>{
    return  axios({
        method:"post",
        url:api.movie.addcomment,
        data,
        headers:{
            Authorization:window.localStorage.getItem("token")
        }
    })
}

export  const  commentQuery = (params:any)=>{
    return  axios({
        method:"get",
        url:api.movie.commentlist,
        params
    })
}

// 看过
export  const  favoriteAdd = (id:any)=>{
    return  axios({
        method:"post",
        url:api.movie.favorite+id,
        headers:{
            Authorization:window.localStorage.getItem("token")
        }
    })
}

// 想看
export  const  likeAdd = (id:any)=>{
    return  axios({
        method:"post",
        url:api.movie.like+id,
        headers:{
            Authorization:window.localStorage.getItem("token")
        }
    })
}